/*
 * 文 件 名 : DateModel.java
 * 版    权 : China Machi.Co.,Ltd.Copyright 2009-2011.All rights reserved
 * 描    述 : <描述>
 * 修 改 人 : wangchd
 * 修改时间 : 2013-1-28
 * 跟踪单号 : <跟踪单号>
 * 修改单号 : <修改单号>
 * 修改内容 : <修改内容>
 */
package com.fire8.dolphin.model;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

import com.fire8.dolphin.utils.DateUtil;

/**
 * <一句话功能简介><br>
 * <功能详细描述>
 *
 * @author  wangchd
 * @version [版本号,2013-1-28]
 * @see     [相关类/方法]
 * @since   [产品/模块]
 */
public class DateModel implements Serializable
{
    private int currYear;
    private int currMonth;
    private int currDay;
    private int currWeek;
    
    public DateModel()
    {
        
    }
    public DateModel(Calendar c)
    {
        setCurrYear(c.get(Calendar.YEAR));
        setCurrMonth(c.get(Calendar.MONTH) + 1);
        setCurrDay(c.get(Calendar.DATE));
        setCurrWeek(c.get(Calendar.DAY_OF_WEEK));
    }
    public int getCurrYear()
    {
        return currYear;
    }
    public void setCurrYear(int currYear)
    {
        this.currYear = currYear;
    }
    public int getCurrMonth()
    {
        return currMonth;
    }
    public void setCurrMonth(int currMonth)
    {
        this.currMonth = currMonth;
    }
    public int getCurrDay()
    {
        return currDay;
    }
    public void setCurrDay(int currDay)
    {
        this.currDay = currDay;
    }
    public int getCurrWeek()
    {
        return currWeek;
    }
    public void setCurrWeek(int currWeek)
    {
        this.currWeek = currWeek;
    }
    
    @Override
    public String toString()
    {
        return DateUtil.StringPattern(currYear + "-"+ currMonth + "-" + currDay, "yyyy-MM-dd","yyyy-MM-dd");
    }
    
    public Date toDate()
    {
        return DateUtil.strToDate(this.toString());
    }
   
    
}
